// define constants for use internal to the mLIB library
//

if (typeof mLIB == 'undefined') function mLIB() {};
mLIB.Includes = {
    ZERO: 1.0e-6,  // our zero. comparing a float to zero using this tolerance
    E: Math.E,      //eulers number - 2.718...
    PI: Math.PI,
    HalfPI: 1.5707963267948966192313216916398,
    twoPI: 2.0*Math.PI,
    
    // abstract the inbuilt Math functions so if necessary we can replace with our own
    abs: Math.abs,       // (x) 	Returns the absolute value of x
    sin: Math.sin,       // (x) 	Returns the sine of x (x is in radians)
    cos: Math.cos,       // (x) 	Returns the cosine of x (x is in radians)
    tan: Math.tan,       // (x)     Returns the tangent of an angle
    asin: Math.asin,     // (x) 	Returns the arcsine of x, in radians
    acos: Math.acos,     // (x) 	Returns the arccosine of x, in radians
    atan: Math.atan,     // (x) 	Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians
    atan2: Math.atan2,   // (y,x) 	Returns the arctangent of the quotient of its arguments
    ceil: Math.ceil,     // (x) 	Returns x, rounded upwards to the nearest integer
    floor: Math.floor,   // (x) 	Returns x, rounded downwards to the nearest integer
    round: Math.round,   // (x) 	Rounds x to the nearest integer
    exp: Math.exp,       // (x) 	Returns the value of E**x
    log: Math.log,       // (x) 	Returns the natural logarithm (base E) of x
    max: Math.max,       // (x,y,z,...,n) 	Returns the number with the highest value
    min: Math.min,       // (x,y,z,...,n) 	Returns the number with the lowest value
    pow: Math.pow,       // (x,y) 	Returns the value of x to the power of y
    sqrt: Math.sqrt,     // (x) 	Returns the square root of x
    random: Math.random, // ()      Returns a random number between 0 and 1
    
    // our utility funcs
    isZero: function(f) { return ( mLIB.Includes.abs(f) <= mLIB.Includes.ZERO ); },           // is value close to zero?
    isEqual: function(f1, f2) { return mLIB.Includes.isZero( f1-f2 ); },   // are the 2 vals closely equal?
	roundToZero: function(f) { return mLIB.Includes.abs(f) <= mLIB.Includes.ZERO ? 0 : f; }
};